file(GLOB_RECURSE PROTOBUF_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.proto)

message(STATUS "Protobuf files found: ${PROTOBUF_FILES}")

protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTOBUF_FILES})

add_library(protocol ${PROTO_SRCS} ${PROTO_HDRS})

target_link_libraries(protocol
  protobuf::libprotobuf
  protobuf::libprotoc
)